// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  console.log(event);
  if(event.action=="clear"){
    const db =cloud.database()
    let goods_collect=db.collection("goods");
    let re =await goods_collect.where({
      "_openid":event.userInfo.openId
    }).remove();
    return{
      result:re
    }
  }
}